<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>             <meta http-equiv="expires" content="0"></meta>             <meta http-equiv="Cache-Control" content="no-cache"></meta>             <meta http-equiv="Cache-Control" content="no-cache"></meta>
        <title>.:DMES:. - Formulación del Producto</title>
        <link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/webStyle.css"/>
        <script type="text/javascript">
            function start() {
                PF('statusDialog').show();
            }

            function stop() {
                PF('statusDialog').hide();
            }
            window.setTimeout("productInit()",1000);
        </script>
    </h:head>
    <h:body style="background-color: #000;">
        <p:ajaxStatus onstart="PF('statusDialog').show()" oncomplete="PF('statusDialog').hide()"/>
        <p:dialog modal="true" widgetVar="statusDialog" header="Cargando..."
                  draggable="false" closable="false" resizable="false">
            <p:graphicImage value="/images/loadBar.gif"/>
        </p:dialog>
        <div>
            <p:growl autoUpdate="true" showDetail="true" life="8000" />

            <!--            $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$                                       -->

            <p:growl autoUpdate="true" showDetail="true" life="8000" />

            <!--            Inicia el dialogo para crear procesos desde guardar-->
            <p:dialog id="dialogprocessSave" widgetVar="dialogprocessSave" draggable="true" 
                      closable="true"  header="Crear Procesos" position="center top" width="900"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">
                <h:form id="formWizardProcessSave" >

                    <p:wizard  flowListener="#{scProductFormulationBean.onFlowProcessSaveProcess}" id="wizardProcessSave" widgetVar="wizardProcessSave" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Proceso" id="tabProcess" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del proceso">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Nombre del Proceso*" />
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText value="#{scProductFormulationBean.processProductSave.name}" />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Tipo de Proceso*" />
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbProcess"  value="#{scProductFormulationBean.processProductSave.processType}" style="width: 70%;"
                                                             converter="typeProcessConverter" converterMessage="Error en el tipo de dato del tipo de proceso"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItem itemLabel="Interno" itemValue="1,Interno"/>
                                                <f:selectItem itemLabel="Externo" itemValue="2,Externo"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Descripción"/>
                                        </td>
                                        <td width="90%" align="left" valign="middle" colspan="3">
                                            <p:inputTextarea value="#{scProductFormulationBean.processProductSave.description}" />
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        inicia pestaña para seleccionar máquinas                          -->
                        <p:tab title="Máquinas" id="tabMachine" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para seleccionar máquinas">
                            <p:panel header="Máquinas" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="cbMachine" value="Máquina"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:selectOneMenu id="cbMachine"  value="#{scProductFormulationBean.processMachineSave.machine}" style="width: 70%;"
                                                                         converter="machineConverter" converterMessage="Error en el tipo de dato de la máquina"
                                                                         effect="puff"
                                                                         height="140">
                                                            <f:selectItem itemLabel="..." />
                                                            <p:ajax event="change" update="tfTimeUse,tfOtherExpenses,tfDescriptionOtherExpenses"/>
                                                            <f:selectItems value="#{scProductFormulationBean.machineList}" var="machine" itemLabel="#{machine.name}"/>
                                                        </p:selectOneMenu>
                                                    </td>
                                                </tr>


                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTimeUse" value="Tiempo de Uso (min)"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTimeUse" value="#{scProductFormulationBean.processMachineSave.timeUse}" 

                                                                     disabled="#{!scProductFormulationBean.doHaveMachine(scProductFormulationBean.processMachineSave.machine)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalMachine()}" update="tfValueTotalMachine"/> 
                                                        </p:inputText>
                                                        <p:tooltip for="tfTimeUse" value="Ingrese el tiempo de uso de la máquina"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfOtherExpenses" value="Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfOtherExpenses" value="#{scProductFormulationBean.processMachineSave.otherExpenses}"
                                                                     disabled="#{!scProductFormulationBean.doHaveMachine(scProductFormulationBean.processMachineSave.machine)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalMachine()}" update="tfValueTotalMachine"/> 
                                                        </p:inputText>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfDescriptionOtherExpenses" value="Descripción Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfDescriptionOtherExpenses" value="#{scProductFormulationBean.processMachineSave.descriptionOtherExpenses}"
                                                                         disabled="#{!scProductFormulationBean.doHaveMachine(scProductFormulationBean.processMachineSave.machine)}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfValueTotalMachine" value="Valor Total Máquina"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfValueTotalMachine" value="#{scProductFormulationBean.processMachineSave.totalValueMachine}"
                                                                     disabled="true"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="cbMachine,tfTimeUse,tfOtherExpenses,tfDescriptionOtherExpenses,tfValueTotalMachine,dataTableMachines"
                                                                             actionListener="#{scProductFormulationBean.saveProcessMachine(scProductFormulationBean.processMachine, scProductFormulationBean.processMachineSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr> 

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableMachines"
                                                         var="machineProcess" 
                                                         value="#{scProductFormulationBean.processMachine}"
                                                         rowKey="#{machineProcess.machine.name}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{machineProcess.machine.name}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableMachines" title="Eliminar Máquina"
                                                                     process="dataTableMachines" 
                                                                     actionListener="#{scProductFormulationBean.deleteMachine(scProductFormulationBean.processMachine, machineProcess)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Máquina" sortBy="#{machineProcess.machine.name}">
                                                    <p:outputLabel value="#{machineProcess.machine.name}" id="machineTable"/>
                                                    <p:tooltip value="#{machineProcess.machine.name}" for="machineTable"/>
                                                </p:column>
                                                <p:column  headerText="Tiempo de Uso (min)" sortBy="#{machineProcess.timeUse}">
                                                    <p:outputLabel value="#{machineProcess.timeUse}" id="outTimeUse"/>
                                                    <p:tooltip value="#{machineProcess.timeUse}" for="outTimeUse"/>
                                                </p:column>
                                                <p:column  headerText="Otros Gastos" sortBy="#{machineProcess.otherExpenses}">
                                                    <p:outputLabel value="#{machineProcess.otherExpenses}" id="outOtherExpenses"/>
                                                    <p:tooltip value="#{machineProcess.otherExpenses}" for="outOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Descripción Otros Gastos" sortBy="#{machineProcess.descriptionOtherExpenses}">
                                                    <p:outputLabel value="#{machineProcess.descriptionOtherExpenses}" id="outDescriptionOtherExpenses"/>
                                                    <p:tooltip value="#{machineProcess.descriptionOtherExpenses}" for="outDescriptionOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{machineProcess.totalValueMachine}">
                                                    <p:outputLabel value="#{machineProcess.totalValueMachine}" id="totalValueMachine"/>
                                                    <p:tooltip value="#{machineProcess.totalValueMachine}" for="totalValueMachine"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para seleccionar máquinas                          -->
                        <!--                        inicia pestaña para seleccionar empleados                          -->
                        <p:tab title="Mano de Obra" id="tabEmployee" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para seleccionar la mano de obra">
                            <p:panel header="Mano de Obra" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tflaborDescription" value="Mano de Obra"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tflaborDescription" value="#{scProductFormulationBean.processEmployeeSave.laborDescription}"
                                                                     />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="cbEmployee" value="Empleado"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:selectOneMenu id="cbEmployee"  value="#{scProductFormulationBean.processEmployeeSave.employee}" style="width: 70%;"
                                                                         converter="employeeConverter" converterMessage="Error en el tipo de dato del empleado"
                                                                         effect="puff"
                                                                         height="140">
                                                            <f:selectItem itemLabel="..." />
                                                            <p:ajax event="change" update="tfTimeUseEmployee,tfOtherExpensesEmployee,tfDescriptionOtherExpensesEmployee"/>
                                                            <f:selectItems value="#{scProductFormulationBean.employeesList}" var="employee" itemLabel="#{employee.position}"/>
                                                        </p:selectOneMenu>
                                                    </td>
                                                </tr>


                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTimeUseEmployee" value="Tiempo de Uso (min)"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTimeUseEmployee" value="#{scProductFormulationBean.processEmployeeSave.timeUse}" 

                                                                     disabled="#{!scProductFormulationBean.doHaveEmployee(scProductFormulationBean.processEmployeeSave.employee)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalEmployee()}" update="tfValueTotalEmployee"/> 
                                                        </p:inputText>
                                                        <p:tooltip for="tfTimeUseEmployee" value="Ingrese el tiempo de uso del empleado para la mano de obra"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfOtherExpensesEmployee" value="Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfOtherExpensesEmployee" value="#{scProductFormulationBean.processEmployeeSave.otherExpenses}"
                                                                     disabled="#{!scProductFormulationBean.doHaveEmployee(scProductFormulationBean.processEmployeeSave.employee)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalEmployee()}" update="tfValueTotalEmployee"/> 
                                                        </p:inputText>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfDescriptionOtherExpensesEmployee" value="Descripción Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfDescriptionOtherExpensesEmployee" value="#{scProductFormulationBean.processEmployeeSave.descriptionOtherExpenses}"
                                                                         disabled="#{!scProductFormulationBean.doHaveEmployee(scProductFormulationBean.processEmployeeSave.employee)}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfValueTotalEmployee" value="Valor Total la Mano de Obra "/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfValueTotalEmployee" value="#{scProductFormulationBean.processEmployeeSave.totalValueEmployee}"
                                                                     disabled="true"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="cbEmployee,tfTimeUseEmployee,tfOtherExpensesEmployee,tfDescriptionOtherExpensesEmployee,tfValueTotalEmployee,tflaborDescription,dataTableEmployees"
                                                                             actionListener="#{scProductFormulationBean.saveProcessEmployee(scProductFormulationBean.processEmployeesListSave, scProductFormulationBean.processEmployeeSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr> 
                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableEmployees"
                                                         var="employeeProcess" 
                                                         value="#{scProductFormulationBean.processEmployeesListSave}"
                                                         rowKey="#{employeeProcess.employee.position}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{employeeProcess.employee.position}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableEmployees" title="Eliminar Mano de Obra"
                                                                     process="dataTableEmployees" 
                                                                     actionListener="#{scProductFormulationBean.deleteEmployee(scProductFormulationBean.processEmployeesListSave, employeeProcess)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Empleado" sortBy="#{employeeProcess.employee.position}">
                                                    <p:outputLabel value="#{employeeProcess.employee.position}" id="employeeTable"/>
                                                    <p:tooltip value="#{employeeProcess.employee.position}" for="employeeTable"/>
                                                </p:column>
                                                <p:column  headerText="Descripción Mano de Obra" sortBy="#{employeeProcess.laborDescription}">
                                                    <p:outputLabel value="#{employeeProcess.laborDescription}" id="outDescriptionLabor"/>
                                                    <p:tooltip value="#{employeeProcess.laborDescription}" for="outDescriptionLabor"/>
                                                </p:column>
                                                <p:column  headerText="Tiempo de Uso (min)" sortBy="#{employeeProcess.timeUse}">
                                                    <p:outputLabel value="#{employeeProcess.timeUse}" id="outTimeUse"/>
                                                    <p:tooltip value="#{employeeProcess.timeUse}" for="outTimeUse"/>
                                                </p:column>
                                                <p:column  headerText="Otros Gastos" sortBy="#{employeeProcess.otherExpenses}">
                                                    <p:outputLabel value="#{employeeProcess.otherExpenses}" id="outOtherExpenses"/>
                                                    <p:tooltip value="#{employeeProcess.otherExpenses}" for="outOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Descripción Otros Gastos" sortBy="#{employeeProcess.descriptionOtherExpenses}">
                                                    <p:outputLabel value="#{employeeProcess.descriptionOtherExpenses}" id="outDescriptionOtherExpenses"/>
                                                    <p:tooltip value="#{employeeProcess.descriptionOtherExpenses}" for="outDescriptionOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{employeeProcess.totalValueEmployee}">
                                                    <p:outputLabel value="#{employeeProcess.totalValueEmployee}" id="totalValueEmployee"/>
                                                    <p:tooltip value="#{employeeProcess.totalValueEmployee}" for="totalValueEmployee"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para seleccionar Empleados                          -->
                        <!--                        inicia pestaña para seleccionar Insumos                          -->
                        <p:tab title="Insumos" id="tabInput" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para seleccionar los insumos">
                            <p:panel header="Insumos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="cbInput" value="Insumo"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:selectOneMenu id="cbInput"  value="#{scProductFormulationBean.processInputSave.input}" style="width: 70%;"
                                                                         converter="inputConverter" converterMessage="Error en el tipo de dato del insumo"
                                                                         effect="puff"
                                                                         height="140">
                                                            <f:selectItem itemLabel="..." />
                                                            <p:ajax event="change" update="tfAmountDistribution,tfPercentageResidue"/>
                                                            <f:selectItems value="#{scProductFormulationBean.inputsList}" var="input" itemLabel="#{input.description}"/>
                                                        </p:selectOneMenu>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfAmountDistribution" value="Cantidad de Distribución"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfAmountDistribution" value="#{scProductFormulationBean.processInputSave.amountDistribution}"                                                                      
                                                                     disabled="#{!scProductFormulationBean.doHaveInput(scProductFormulationBean.processInputSave.input)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalInput()}" update="tfValueTotalInput"/> 
                                                        </p:inputText>
                                                        <p:tooltip for="tfAmountDistribution" value="Ingrese la cantidad de distribución del insumo"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfPercentageResidue" value="% de Merma (Desperdicio)"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfPercentageResidue" value="#{scProductFormulationBean.processInputSave.percentageResidue}"
                                                                     disabled="#{!scProductFormulationBean.doHaveInput(scProductFormulationBean.processInputSave.input)}">
                                                        </p:inputText>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfValueTotalInput" value="Valor Total del Insumo"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfValueTotalInput" value="#{scProductFormulationBean.processInputSave.totalValueInput}"
                                                                     disabled="true"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="cbInput,tfValueTotalInput,tfPercentageResidue,tfAmountDistribution,dataTableInputs"
                                                                             actionListener="#{scProductFormulationBean.saveProcessInput(scProductFormulationBean.processInputsListSave, scProductFormulationBean.processInputSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr> 
                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableInputs"
                                                         var="inputProcess" 
                                                         value="#{scProductFormulationBean.processInputsListSave}"
                                                         rowKey="#{inputProcess.input.idInput}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{inputProcess.input.idInput}"> 
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableInputs" title="Eliminar Insumo"
                                                                     process="dataTableInputs" 
                                                                     actionListener="#{scProductFormulationBean.deleteInput(scProductFormulationBean.processInputsListSave, inputProcess)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Insumo" sortBy="#{inputProcess.input.description}">
                                                    <p:outputLabel value="#{inputProcess.input.description}" id="inputOut"/>
                                                    <p:tooltip value="#{inputProcess.input.description}" for="inputOut"/>
                                                </p:column>
                                                <p:column  headerText="Cantidad de Distribución" sortBy="#{inputProcess.amountDistribution} #{inputProcess.input.distributionUnit.acronym}">
                                                    <p:outputLabel value="#{inputProcess.amountDistribution} #{inputProcess.input.distributionUnit.acronym}" id="outAmountDistribution"/>
                                                    <p:tooltip value="#{inputProcess.amountDistribution} #{inputProcess.input.distributionUnit.acronym}" for="outAmountDistribution"/>
                                                </p:column>
                                                <p:column  headerText="% de Merma (Desperdicios)" sortBy="#{inputProcess.percentageResidue}">
                                                    <p:outputLabel value="#{inputProcess.percentageResidue}" id="outPercentage"/>
                                                    <p:tooltip value="#{inputProcess.percentageResidue}" for="outPercentage"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{inputProcess.totalValueInput} #{inputProcess.input.money.acronym}">
                                                    <p:outputLabel value="#{inputProcess.totalValueInput} #{inputProcess.input.money.acronym}" id="totalValueInput"/>
                                                    <p:tooltip value="#{inputProcess.totalValueInput} #{inputProcess.input.money.acronym}" for="totalValueInput"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para seleccionar Insumos                          -->
                        <!--                        inicia pestaña para guardar cambios                          -->
                        <p:tab title="Confirmar Proceso" id="tabConfirm" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para confirmar el proceso">
                            <p:panel header="Confirmar Proceso" >

                                <table width="100%" cellspacing="10">
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfNameconfirm" value="Nombre del Proceso"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfNameconfirm" value="#{scProductFormulationBean.processProductSave.name}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="40%" >
                                            <p:outputLabel for="tfTypeProcess" value="Tipo de Proceso"/>
                                        </td>
                                        <td width="60%">
                                            <p:inputText id="tfTypeProcess" value="#{scProductFormulationBean.processProductSave.processType.type}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfDescriptionProcess" value="Descripción del Proceso"/>
                                        </td>
                                        <td width="40%" >
                                            <p:inputTextarea id="tfDescriptionProcess" value="#{scProductFormulationBean.processProductSave.description}"
                                                         disabled="true">
                                            </p:inputTextarea>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueInput" value="Total Valor Insumo"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueInput" value="#{scProductFormulationBean.processProductSave.totalValueInput}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalTimeMachine" value="Total Tiempo Máquina"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalTimeMachine" value="#{scProductFormulationBean.processProductSave.totalTimeMachine}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueMachine" value="Total Valor Máquina"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueMachine" value="#{scProductFormulationBean.processProductSave.totalValueMachine}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalTimeEmployee" value="Total Tiempo Empleado"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalTimeEmployee" value="#{scProductFormulationBean.processProductSave.totalTimeEmployee}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueEmployee" value="Total Valor Empleado"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueEmployee" value="#{scProductFormulationBean.processProductSave.totalValueEmployee}"
                                                         disabled="true"/>
                                        </td>
                                    </tr> 
                                   <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalProcesTime" value="Total Tiempo Proceso"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalProcesTime" value="#{scProductFormulationBean.processProductSave.totalTimeProcess}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueProcess" value="Total Valor Proceso"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueProcess" value="#{scProductFormulationBean.processProductSave.totalValueProcess}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="4">
                                            <p:commandButton value="Guardar" 
                                            actionListener="#{scProductFormulationBean.saveProcessProduct(scProductFormulationBean.productSave, scProductFormulationBean.processProductListSave, scProductFormulationBean.processProductSave)}"
                                            update=":formWizardProcessSave,:formWizardSave:dataTableProcessSave" oncomplete="PF('dialogprocessSave').hide();PF('wizardProcessSave').loadStep('tabProcess', true)"/>
                                            <p:spacer width="20px"/>
                                            <p:commandButton value="Cancelar" actionListener="#{scProductFormulationBean.cleanFieldsProcess()}"
                                                             update=":formWizardProcessSave" oncomplete="PF('dialogprocessSave').hide();PF('wizardProcessSave').loadStep('tabProcess', true)"/>
                                        </td>
                                    </tr>
                                </table>

                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para confirmar el proceso                  -->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardProcessSave').loadStep('tabProcess', true)" listener="#{scProductFormulationBean.cleanProcessComplete()}"/>
            </p:dialog>
<!--            fianliza el dialogo para crear procesos desde guardar-->
<!--====================================================================================================================================================-->
<!--            Inicia el dialogo para crear procesos desde actualizar-->
            <p:dialog id="dialogprocessUpdate" widgetVar="dialogprocessUpdate" draggable="true" 
                      closable="true"  header="Actualizar Procesos" position="center top" width="900"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">
                <h:form id="formWizardProcessUpdate" >

                    <p:wizard  flowListener="#{scProductFormulationBean.onFlowProcessSaveProcess}" id="wizardProcessUpdate" widgetVar="wizardProcessUpdate" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Proceso" id="tabProcess" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del proceso">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Nombre del Proceso*" />
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText value="#{scProductFormulationBean.processProductSave.name}" />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Tipo de Proceso*" />
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbProcess"  value="#{scProductFormulationBean.processProductSave.processType}" style="width: 70%;"
                                                             converter="typeProcessConverter" converterMessage="Error en el tipo de dato del tipo de proceso"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItem itemLabel="Interno" itemValue="1,Interno"/>
                                                <f:selectItem itemLabel="Externo" itemValue="2,Externo"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Descripción"/>
                                        </td>
                                        <td width="90%" align="left" valign="middle" colspan="3">
                                            <p:inputTextarea value="#{scProductFormulationBean.processProductSave.description}" />
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        inicia pestaña para seleccionar máquinas                          -->
                        <p:tab title="Máquinas" id="tabMachine" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para seleccionar máquinas">
                            <p:panel header="Máquinas" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="cbMachine" value="Máquina"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:selectOneMenu id="cbMachine"  value="#{scProductFormulationBean.processMachineSave.machine}" style="width: 70%;"
                                                                         converter="machineConverter" converterMessage="Error en el tipo de dato de la máquina"
                                                                         effect="puff"
                                                                         height="140">
                                                            <f:selectItem itemLabel="..." />
                                                            <p:ajax event="change" update="tfTimeUse,tfOtherExpenses,tfDescriptionOtherExpenses"/>
                                                            <f:selectItems value="#{scProductFormulationBean.machineList}" var="machine" itemLabel="#{machine.name}"/>
                                                        </p:selectOneMenu>
                                                    </td>
                                                </tr>


                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTimeUse" value="Tiempo de Uso (min)"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTimeUse" value="#{scProductFormulationBean.processMachineSave.timeUse}" 

                                                                     disabled="#{!scProductFormulationBean.doHaveMachine(scProductFormulationBean.processMachineSave.machine)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalMachine()}" update="tfValueTotalMachine"/> 
                                                        </p:inputText>
                                                        <p:tooltip for="tfTimeUse" value="Ingrese el tiempo de uso de la máquina"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfOtherExpenses" value="Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfOtherExpenses" value="#{scProductFormulationBean.processMachineSave.otherExpenses}"
                                                                     disabled="#{!scProductFormulationBean.doHaveMachine(scProductFormulationBean.processMachineSave.machine)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalMachine()}" update="tfValueTotalMachine"/> 
                                                        </p:inputText>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfDescriptionOtherExpenses" value="Descripción Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfDescriptionOtherExpenses" value="#{scProductFormulationBean.processMachineSave.descriptionOtherExpenses}"
                                                                         disabled="#{!scProductFormulationBean.doHaveMachine(scProductFormulationBean.processMachineSave.machine)}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfValueTotalMachine" value="Valor Total Máquina"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfValueTotalMachine" value="#{scProductFormulationBean.processMachineSave.totalValueMachine}"
                                                                     disabled="true"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="cbMachine,tfTimeUse,tfOtherExpenses,tfDescriptionOtherExpenses,tfValueTotalMachine,dataTableMachines"
                                                                             actionListener="#{scProductFormulationBean.saveProcessMachine(scProductFormulationBean.processMachine, scProductFormulationBean.processMachineSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr> 

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableMachines"
                                                         var="machineProcess" 
                                                         value="#{scProductFormulationBean.processMachine}"
                                                         rowKey="#{machineProcess.machine.name}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{machineProcess.machine.name}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableMachines" title="Eliminar Máquina"
                                                                     process="dataTableMachines" 
                                                                     actionListener="#{scProductFormulationBean.deleteMachine(scProductFormulationBean.processMachine, machineProcess)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Máquina" sortBy="#{machineProcess.machine.name}">
                                                    <p:outputLabel value="#{machineProcess.machine.name}" id="machineTable"/>
                                                    <p:tooltip value="#{machineProcess.machine.name}" for="machineTable"/>
                                                </p:column>
                                                <p:column  headerText="Tiempo de Uso (min)" sortBy="#{machineProcess.timeUse}">
                                                    <p:outputLabel value="#{machineProcess.timeUse}" id="outTimeUse"/>
                                                    <p:tooltip value="#{machineProcess.timeUse}" for="outTimeUse"/>
                                                </p:column>
                                                <p:column  headerText="Otros Gastos" sortBy="#{machineProcess.otherExpenses}">
                                                    <p:outputLabel value="#{machineProcess.otherExpenses}" id="outOtherExpenses"/>
                                                    <p:tooltip value="#{machineProcess.otherExpenses}" for="outOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Descripción Otros Gastos" sortBy="#{machineProcess.descriptionOtherExpenses}">
                                                    <p:outputLabel value="#{machineProcess.descriptionOtherExpenses}" id="outDescriptionOtherExpenses"/>
                                                    <p:tooltip value="#{machineProcess.descriptionOtherExpenses}" for="outDescriptionOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{machineProcess.totalValueMachine}">
                                                    <p:outputLabel value="#{machineProcess.totalValueMachine}" id="totalValueMachine"/>
                                                    <p:tooltip value="#{machineProcess.totalValueMachine}" for="totalValueMachine"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para seleccionar máquinas                          -->
                        <!--                        inicia pestaña para seleccionar empleados                          -->
                        <p:tab title="Mano de Obra" id="tabEmployee" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para seleccionar la mano de obra">
                            <p:panel header="Mano de Obra" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tflaborDescription" value="Mano de Obra"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tflaborDescription" value="#{scProductFormulationBean.processEmployeeSave.laborDescription}"
                                                                     />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="cbEmployee" value="Empleado"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:selectOneMenu id="cbEmployee"  value="#{scProductFormulationBean.processEmployeeSave.employee}" style="width: 70%;"
                                                                         converter="employeeConverter" converterMessage="Error en el tipo de dato del empleado"
                                                                         effect="puff"
                                                                         height="140">
                                                            <f:selectItem itemLabel="..." />
                                                            <p:ajax event="change" update="tfTimeUseEmployee,tfOtherExpensesEmployee,tfDescriptionOtherExpensesEmployee"/>
                                                            <f:selectItems value="#{scProductFormulationBean.employeesList}" var="employee" itemLabel="#{employee.position}"/>
                                                        </p:selectOneMenu>
                                                    </td>
                                                </tr>


                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTimeUseEmployee" value="Tiempo de Uso (min)"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTimeUseEmployee" value="#{scProductFormulationBean.processEmployeeSave.timeUse}" 

                                                                     disabled="#{!scProductFormulationBean.doHaveEmployee(scProductFormulationBean.processEmployeeSave.employee)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalEmployee()}" update="tfValueTotalEmployee"/> 
                                                        </p:inputText>
                                                        <p:tooltip for="tfTimeUseEmployee" value="Ingrese el tiempo de uso del empleado para la mano de obra"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfOtherExpensesEmployee" value="Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfOtherExpensesEmployee" value="#{scProductFormulationBean.processEmployeeSave.otherExpenses}"
                                                                     disabled="#{!scProductFormulationBean.doHaveEmployee(scProductFormulationBean.processEmployeeSave.employee)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalEmployee()}" update="tfValueTotalEmployee"/> 
                                                        </p:inputText>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfDescriptionOtherExpensesEmployee" value="Descripción Otros Gastos"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfDescriptionOtherExpensesEmployee" value="#{scProductFormulationBean.processEmployeeSave.descriptionOtherExpenses}"
                                                                         disabled="#{!scProductFormulationBean.doHaveEmployee(scProductFormulationBean.processEmployeeSave.employee)}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfValueTotalEmployee" value="Valor Total la Mano de Obra "/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfValueTotalEmployee" value="#{scProductFormulationBean.processEmployeeSave.totalValueEmployee}"
                                                                     disabled="true"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="cbEmployee,tfTimeUseEmployee,tfOtherExpensesEmployee,tfDescriptionOtherExpensesEmployee,tfValueTotalEmployee,tflaborDescription,dataTableEmployees"
                                                                             actionListener="#{scProductFormulationBean.saveProcessEmployee(scProductFormulationBean.processEmployeesListSave, scProductFormulationBean.processEmployeeSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr> 
                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableEmployees"
                                                         var="employeeProcess" 
                                                         value="#{scProductFormulationBean.processEmployeesListSave}"
                                                         rowKey="#{employeeProcess.employee.position}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{employeeProcess.employee.position}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableEmployees" title="Eliminar Mano de Obra"
                                                                     process="dataTableEmployees" 
                                                                     actionListener="#{scProductFormulationBean.deleteEmployee(scProductFormulationBean.processEmployeesListSave, employeeProcess)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Empleado" sortBy="#{employeeProcess.employee.position}">
                                                    <p:outputLabel value="#{employeeProcess.employee.position}" id="employeeTable"/>
                                                    <p:tooltip value="#{employeeProcess.employee.position}" for="employeeTable"/>
                                                </p:column>
                                                <p:column  headerText="Descripción Mano de Obra" sortBy="#{employeeProcess.laborDescription}">
                                                    <p:outputLabel value="#{employeeProcess.laborDescription}" id="outDescriptionLabor"/>
                                                    <p:tooltip value="#{employeeProcess.laborDescription}" for="outDescriptionLabor"/>
                                                </p:column>
                                                <p:column  headerText="Tiempo de Uso (min)" sortBy="#{employeeProcess.timeUse}">
                                                    <p:outputLabel value="#{employeeProcess.timeUse}" id="outTimeUse"/>
                                                    <p:tooltip value="#{employeeProcess.timeUse}" for="outTimeUse"/>
                                                </p:column>
                                                <p:column  headerText="Otros Gastos" sortBy="#{employeeProcess.otherExpenses}">
                                                    <p:outputLabel value="#{employeeProcess.otherExpenses}" id="outOtherExpenses"/>
                                                    <p:tooltip value="#{employeeProcess.otherExpenses}" for="outOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Descripción Otros Gastos" sortBy="#{employeeProcess.descriptionOtherExpenses}">
                                                    <p:outputLabel value="#{employeeProcess.descriptionOtherExpenses}" id="outDescriptionOtherExpenses"/>
                                                    <p:tooltip value="#{employeeProcess.descriptionOtherExpenses}" for="outDescriptionOtherExpenses"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{employeeProcess.totalValueEmployee}">
                                                    <p:outputLabel value="#{employeeProcess.totalValueEmployee}" id="totalValueEmployee"/>
                                                    <p:tooltip value="#{employeeProcess.totalValueEmployee}" for="totalValueEmployee"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para seleccionar Empleados                          -->
                        <!--                        inicia pestaña para seleccionar Insumos                          -->
                        <p:tab title="Insumos" id="tabInput" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para seleccionar los insumos">
                            <p:panel header="Insumos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="cbInput" value="Insumo"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:selectOneMenu id="cbInput"  value="#{scProductFormulationBean.processInputSave.input}" style="width: 70%;"
                                                                         converter="inputConverter" converterMessage="Error en el tipo de dato del insumo"
                                                                         effect="puff"
                                                                         height="140">
                                                            <f:selectItem itemLabel="..." />
                                                            <p:ajax event="change" update="tfAmountDistribution,tfPercentageResidue"/>
                                                            <f:selectItems value="#{scProductFormulationBean.inputsList}" var="input" itemLabel="#{input.description}"/>
                                                        </p:selectOneMenu>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfAmountDistribution" value="Cantidad de Distribución"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfAmountDistribution" value="#{scProductFormulationBean.processInputSave.amountDistribution}"                                                                      
                                                                     disabled="#{!scProductFormulationBean.doHaveInput(scProductFormulationBean.processInputSave.input)}">
                                                            <p:ajax event="change" listener="#{scProductFormulationBean.sumValueTotalInput()}" update="tfValueTotalInput"/> 
                                                        </p:inputText>
                                                        <p:tooltip for="tfAmountDistribution" value="Ingrese el tiempo de uso del insumo"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfPercentageResidue" value="% de Merma (Desperdicio)"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfPercentageResidue" value="#{scProductFormulationBean.processInputSave.percentageResidue}"
                                                                     disabled="#{!scProductFormulationBean.doHaveInput(scProductFormulationBean.processInputSave.input)}">
                                                        </p:inputText>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfValueTotalInput" value="Valor Total del Insumo"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfValueTotalInput" value="#{scProductFormulationBean.processInputSave.totalValueInput}"
                                                                     disabled="true"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="cbInput,tfValueTotalInput,tfPercentageResidue,tfAmountDistribution,dataTableInputs"
                                                                             actionListener="#{scProductFormulationBean.saveProcessInput(scProductFormulationBean.processInputsListSave, scProductFormulationBean.processInputSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr> 
                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableInputs"
                                                         var="inputProcess" 
                                                         value="#{scProductFormulationBean.processInputsListSave}"
                                                         rowKey="#{inputProcess.input.idInput}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{inputProcess.input.idInput}"> 
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableInputs" title="Eliminar Insumo"
                                                                     process="dataTableInputs" 
                                                                     actionListener="#{scProductFormulationBean.deleteInput(scProductFormulationBean.processInputsListSave, inputProcess)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Insumo" sortBy="#{inputProcess.input.description}">
                                                    <p:outputLabel value="#{inputProcess.input.description}" id="inputOut"/>
                                                    <p:tooltip value="#{inputProcess.input.description}" for="inputOut"/>
                                                </p:column>
                                                <p:column  headerText="Cantidad de Distribución" sortBy="#{inputProcess.amountDistribution} #{inputProcess.input.distributionUnit.acronym}">
                                                    <p:outputLabel value="#{inputProcess.amountDistribution} #{inputProcess.input.distributionUnit.acronym}" id="outAmountDistribution"/>
                                                    <p:tooltip value="#{inputProcess.amountDistribution} #{inputProcess.input.distributionUnit.acronym}" for="outAmountDistribution"/>
                                                </p:column>
                                                <p:column  headerText="% de Merma (Desperdicios)" sortBy="#{inputProcess.percentageResidue}">
                                                    <p:outputLabel value="#{inputProcess.percentageResidue}" id="outPercentage"/>
                                                    <p:tooltip value="#{inputProcess.percentageResidue}" for="outPercentage"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{inputProcess.totalValueInput} #{inputProcess.input.money.acronym}">
                                                    <p:outputLabel value="#{inputProcess.totalValueInput} #{inputProcess.input.money.acronym}" id="totalValueInput"/>
                                                    <p:tooltip value="#{inputProcess.totalValueInput} #{inputProcess.input.money.acronym}" for="totalValueInput"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para seleccionar Insumos                          -->
                        <!--                        inicia pestaña para guardar cambios                          -->
                        <p:tab title="Confirmar Proceso" id="tabConfirm" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para confirmar el proceso">
                            <p:panel header="Confirmar Proceso" >

                                <table width="100%" cellspacing="10">
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfNameconfirm" value="Nombre del Proceso"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfNameconfirm" value="#{scProductFormulationBean.processProductSave.name}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="40%" >
                                            <p:outputLabel for="tfTypeProcess" value="Tipo de Proceso"/>
                                        </td>
                                        <td width="60%">
                                            <p:inputText id="tfTypeProcess" value="#{scProductFormulationBean.processProductSave.processType.type}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfDescriptionProcess" value="Descripción del Proceso"/>
                                        </td>
                                        <td width="40%" >
                                            <p:inputTextarea id="tfDescriptionProcess" value="#{scProductFormulationBean.processProductSave.description}"
                                                         disabled="true">
                                            </p:inputTextarea>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueInput" value="Total Valor Insumo"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueInput" value="#{scProductFormulationBean.processProductSave.totalValueInput}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalTimeMachine" value="Total Tiempo Máquina"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalTimeMachine" value="#{scProductFormulationBean.processProductSave.totalTimeMachine}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueMachine" value="Total Valor Máquina"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueMachine" value="#{scProductFormulationBean.processProductSave.totalValueMachine}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalTimeEmployee" value="Total Tiempo Empleado"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalTimeEmployee" value="#{scProductFormulationBean.processProductSave.totalTimeEmployee}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueEmployee" value="Total Valor Empleado"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueEmployee" value="#{scProductFormulationBean.processProductSave.totalValueEmployee}"
                                                         disabled="true"/>
                                        </td>
                                    </tr> 
                                   <tr>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalProcesTime" value="Total Tiempo Proceso"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalProcesTime" value="#{scProductFormulationBean.processProductSave.totalTimeProcess}"
                                                         disabled="true">
                                            </p:inputText>
                                        </td>
                                        <td width="10%" >
                                            <p:outputLabel for="tfTotalValueProcess" value="Total Valor Proceso"/>
                                        </td>
                                        <td width="40%">
                                            <p:inputText id="tfTotalValueProcess" value="#{scProductFormulationBean.processProductSave.totalValueProcess}"
                                                         disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="4">
                                            <p:commandButton value="Guardar" 
                                                             actionListener="#{scProductFormulationBean.saveProcessProduct(scProductFormulationBean.productSelected, scProductFormulationBean.productSelected.processProducts, scProductFormulationBean.processProductSave)}"
                                            update=":formWizardProcessUpdate,:formWizardUpdate:dataTableProcessUpdate" oncomplete="PF('dialogprocessUpdate').hide();PF('wizardProcessUpdate').loadStep('tabProcess', true)"/>
                                            <p:spacer width="20px"/>
                                            <p:commandButton value="Cancelar" actionListener="#{scProductFormulationBean.cleanFieldsProcess()}"
                                                             update=":formWizardProcessUpdate" oncomplete="PF('dialogprocessUpdate').hide();PF('wizardProcessUpdate').loadStep('tabProcess', true)"/>
                                        </td>
                                    </tr>
                                </table>

                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para confirmar el proceso                  -->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardProcessUpdate').loadStep('tabProcess', true)" listener="#{scProductFormulationBean.cleanProcessComplete()}"/>
            </p:dialog>
<!--            finaliza el dialogo para crear nuevos procesos de producto desde actualizar-->
<!--=======================================================================================================================================================-->
            <!--            Inicia el dialogo para crear nuevas formulaciones de producto-->
            <p:dialog id="dialogproductSave" widgetVar="dialogproductSave" draggable="true" 
                      closable="true"  header="Crear Productos" position="center top" width="900"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">
                <h:form id="formWizardSave" >

                    <p:wizard  flowListener="#{scProductFormulationBean.onFlowProcessSaveProduct}" id="wizardSave" widgetVar="wizardSave" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del producto">

                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scProductFormulationBean.searchImage(scProductFormulationBean.productSave.pathPicture)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnPicture" icon="ui-icon-image"  oncomplete="PF('pictureSave').show()" style="top: -10px;"
                                                              ignoreAutoUpdate="true"/>                                       
                                        </td>
                                        
                                        <td colspan="2"></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameProductFormulation" value="Nombre Producto*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameProductFormulation"  value="#{scProductFormulationBean.productSave.description}"
                                                            />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDate" value="Fecha de Caducidad"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:calendar    id="tfExpiryDate"  value="#{scProductFormulationBean.productSave.expiryDate}" autocomplete="true"
                                                           effect="explode" mask="true" pattern="dd/MM/yyyy"
                                                           />
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterial" value="Tipo de Material*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfTypeMaterial"  value="#{scProductFormulationBean.productSave.typeMaterial}" autocomplete="true"
                                                            requiredMessage="Debe ingresar el tipo de material" />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueProductFormulation" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueProductFormulation"  value="#{scProductFormulationBean.productSave.value}" 
                                                            requiredMessage="Debe ingresar el valor del producto" style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scProductFormulationBean.productSave.money}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scProductFormulationBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkProductFormulation" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkProductFormulation"  value="#{scProductFormulationBean.productSave.mark}"
                                                            requiredMessage="Campo obligatorio debe ingresar la marca del producto"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieProductFormulation" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieProductFormulation"  value="#{scProductFormulationBean.productSave.serie}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scProductFormulationBean.productSave.supplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scProductFormulationBean.productSave.costCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scProductFormulationBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddCostCenter" icon="ui-icon-circle-plus"  oncomplete="PF('centerCostSave').show()" style="top: -8px;"/>
                                            <p:tooltip for="btnAddCostCenter" value="Agregue nuevos centros de costos"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfStore" value="Almacén*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfStore"  value="#{scProductFormulationBean.storeSelected}" style="width: 70%;"
                                                             converter="storeConverter" converterMessage="Error en el tipo de dato del almacén"
                                                             effect="puff"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.storesList}" var="stores" itemLabel="#{stores.name}"/>
                                                <p:ajax event="change" update="cbLocation,btnAddLocationProductFormulation" listener="#{scProductFormulationBean.withOutStore(scProductFormulationBean.storeSelected)}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbLocation" value="Localización*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbLocation"  value="#{scProductFormulationBean.productSave.location}" style="width: 70%;" 
                                                             converter="inputLocationConverter" converterMessage="Error en el tipo de dato de la localización del producto"
                                                             effect="puff" disabled="#{scProductFormulationBean.withOutStore(scProductFormulationBean.storeSelected)}"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scProductFormulationBean.inputLocationsList}" var="inputLocations" itemLabel="#{inputLocations.location}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddLocationProductFormulation" icon="ui-icon-circle-plus"  oncomplete="PF('inputLocationSave').show()" style="top: -8px;"
                                                              disabled ="#{scProductFormulationBean.withOutStore(scProductFormulationBean.storeSelected)}"/>
                                            <p:tooltip for="btnAddLocationProductFormulation" value="Agregue nuevas localizaciones"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scProductFormulationBean.productSave.priority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbPackingUnit" value="Unidad de Empaque*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbPackingUnit"  value="#{scProductFormulationBean.productSave.packingUnit}" 
                                                             converter="packingUnitConverter" converterMessage="Error en el tipo de dato de la unidad de empaque" style="width: 70%; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scProductFormulationBean.packingUnitsList}" var="units" itemLabel="#{units.acronym}"/>

                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddPackingUnit" icon="ui-icon-circle-plus"  oncomplete="PF('unitPackingSave').show()" style="top: -2px;"/>
                                            <p:tooltip for="btnAddPackingUnit" value="Agregue nuevas unidades de empaque"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales-->

                        <!--                        inicia la pestaña para las dimensiones-->
                        <p:tab title="Dimensiones" id="tabDimension" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las dimensiones">

                            <p:panel header="Dimensiones" id="pnlDimension">
                                <f:facet name="header">
                                    <p:commandButton icon="ui-icon-plus" id="btnAddMeasure" style="float: right;"  
                                                     oncomplete="PF('measureSave').show()">
                                        <p:tooltip for="btnAddMeasure" value="Agregar una medida"/>
                                    </p:commandButton>
                                </f:facet>
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scProductFormulationBean.productSave.dimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scProductFormulationBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.hight, 1)}" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scProductFormulationBean.productSave.dimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scProductFormulationBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.width, 2)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scProductFormulationBean.productSave.dimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scProductFormulationBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.large, 3)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scProductFormulationBean.productSave.dimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; ">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scProductFormulationBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.volume, 4)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scProductFormulationBean.productSave.dimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scProductFormulationBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.thickness, 5)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scProductFormulationBean.productSave.dimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scProductFormulationBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.radio, 6)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scProductFormulationBean.productSave.dimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scProductFormulationBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSave.dimension.weight, 7)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scProductFormulationBean.productSave.dimension.observations}"
                                                               style="width: 98%;"     />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para dimensiones-->
                        <!--                        inicia pestaña para especificaciones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones del producto">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleSpecification" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleSpecification" value="#{scProductFormulationBean.specificationsSave.tittle}"/>
                                                        <p:tooltip for="tfTittleSpecification" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfSpecificationSave" value="Especificación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfSpecificationSave" value="#{scProductFormulationBean.specificationsSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleSpecification,tfSpecificationSave,dataTableSpecificationSave"
                                                                             actionListener="#{scProductFormulationBean.saveSpecification()}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationSave"
                                                         var="specifications" 
                                                         value="#{scProductFormulationBean.specificationListSave}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationSave" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationSave" 
                                                                     actionListener="#{scProductFormulationBean.deleteSpecifications(specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características del producto">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleFeacture" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleFeacture" value="#{scProductFormulationBean.feacturesSave.tittle}"/>
                                                        <p:tooltip for="tfTittleFeacture" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfFeactureSave" value="Característica"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfFeactureSave" value="#{scProductFormulationBean.feacturesSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleFeacture,tfFeactureSave,dataTableFeactureSave"
                                                                             actionListener="#{scProductFormulationBean.saveFeacture()}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scProductFormulationBean.feacturesListSave}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scProductFormulationBean.deleteFeactures(feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones del producto">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleObservation" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleObservation" value="#{scProductFormulationBean.observationsSave.tittle}"/>
                                                        <p:tooltip for="tfTittleObservation" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfObservationSave" value="Observación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfObservationSave" value="#{scProductFormulationBean.observationsSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleObservation,tfObservationSave,dataTableObservationSave"
                                                                             actionListener="#{scProductFormulationBean.saveObservation()}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scProductFormulationBean.observationListSave}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scProductFormulationBean.deleteObservation(observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del producto">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scProductFormulationBean.documentsListSave}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                                                     oncomplete="PF('documentSave').show()">
                                                        <p:tooltip for="btnAdd" value="Agregar un Documento"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableDocumentationSave" title="Eliminar Documentos"
                                                                     process="@this" 
                                                                     actionListener="#{scProductFormulationBean.deleteDocument(documents)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->   
                        <!--                        inicia pestaña para procesos-->
                        <p:tab title="Procesos" id="tabProcess" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del producto">
                            <p:panel header="Procesos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableProcessSave"
                                                         var="process" 
                                                         value="#{scProductFormulationBean.processProductListSave}"
                                                         rowKey="#{process.idProcessProduct}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{process.idProcessProduct}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAddProcess" style="float: right;"  
                                                                     oncomplete="PF('dialogprocessSave').show()">
                                                        <p:tooltip for="btnAddProcess" value="Agregar un Proceso"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="text-align: center;">
                                                    
                                                    <p:commandButton icon="ui-icon-pencil" title="Actualizar Proceso"
                                                                     process="@this" oncomplete="PF('dialogprocessSave').show()" update=":formWizardProcessSave"
                                                                     actionListener="#{scProductFormulationBean.selectedForUpdateFromSave(process)}" >
                                                    </p:commandButton>
                                                    <p:spacer width="5"/>
                                                    <p:commandButton icon="ui-icon-close" update="dataTableProcessSave" title="Eliminar Proceso"
                                                                     process="@this" 
                                                                     actionListener="#{scProductFormulationBean.deleteProcess(scProductFormulationBean.processProductListSave, process)}" >
                                                    </p:commandButton>
                                                    
                                                </p:column>
                                                <p:column  headerText="Proceso" sortBy="#{process.name}">
                                                    <p:outputLabel value="#{process.name}" id="processName"/>
                                                    <p:tooltip value="#{process.name}" for="processName"/>
                                                </p:column>               
                                                <p:column  headerText="Tipo" sortBy="#{process.processType.type}">
                                                    <p:outputLabel value="#{process.processType.type}" id="processType"/>
                                                    <p:tooltip value="#{process.processType.type}" for="processType"/>
                                                </p:column>
                                                <p:column  headerText="Descripción" sortBy="#{process.description}">
                                                    <p:outputLabel value="#{process.description}" id="processDescription"/>
                                                    <p:tooltip value="#{process.description}" for="processDescription"/>
                                                </p:column>
                                                <p:column  headerText="Tiempo Total" sortBy="#{process.totalTimeProcess}">
                                                    <p:outputLabel value="#{process.totalTimeProcess} minutos" id="totalTimeProcess"/>
                                                    <p:tooltip value="#{process.totalTimeProcess}" for="totalTimeProcess"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{process.totalValueProcess}">
                                                    <p:outputLabel value="#{process.totalValueProcess} $" id="totalValueProcess"/>
                                                    <p:tooltip value="#{process.totalValueProcess} $" for="totalValueProcess"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para procesos                     -->   


                        <!--        inicia la pestaña para confirmar datos de guardar-->
                        <p:tab title="Confirmar datos" id="tabConfirmSave" titleStyleClass="tabTittleSavePerson"
                               titletip="Pestaña para confirmar los datos del Producto a crear">
                            <p:panel header="Crear Producto" style="text-align: center;">
                                <table width="98%" cellspacing="10" style="text-align: center;">
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameproductSave" value="Nombre Producto"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfNameproductSave"  value="#{scProductFormulationBean.productSave.description}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDateSave" value="Tiempo de Preparación"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfExpiryDateSave"  value="#{scProductFormulationBean.productSave.manufacturingTime} Minutos"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterialSave" value="Tipo de Material"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfTypeMaterialSave"  value="#{scProductFormulationBean.productSave.typeMaterial}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueproductSave" value="Valor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfValueproductSave"  value="#{scProductFormulationBean.productSave.value}"/>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkproductSave" value="Marca"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfMarkproductSave"  value="#{scProductFormulationBean.productSave.mark}"
                                                              />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieproductSave" value="Serie"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfSerieproductSave"  value="#{scProductFormulationBean.productSave.serie}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="98%" colspan="2">
                                            <p:commandButton id="btnSaveProductFormulation" value="Guardar Producto" onsuccess="PF('dialogproductSave').hide()"
                                                             actionListener="#{scProductFormulationBean.saveProductFormulation()}" update=":formProductFormulation:scDataTableProductFormulations,:formWizardSave"
                                                             oncomplete="PF('wizardSave').loadStep('tabGeneral', false)"/>
                                            <p:spacer width="30"/>
                                            <p:commandButton id="btnCancelPartner" value="Cancelar" oncomplete="PF('dialogproductSave').hide();PF('wizardSave').loadStep('tabGeneral', false)"
                                                             actionListener="#{scProductFormulationBean.cleanProductSave()}"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>

                        </p:tab>
                        <!--        finaliza la pestaña para confirmar datos de guardar-->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardSave').loadStep('tabGeneral', true)"  listener="#{scProductFormulationBean.cleanProductSave()}"/>
            </p:dialog>
            <!--                Finaliza el dialogo para crear nuevas formulaciones de producto-->

            <!--====================================================================================================================================================-->
            <!--            Inicia el dialogo para visualizar formulaciones de producto-->
            <p:dialog id="dialogProductView" widgetVar="dialogProductView" draggable="true" 
                      closable="true"  header="Crear Productos" position="center top" width="900"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">
                <h:form id="formWizardView" >

                    <p:wizard  flowListener="#{scProductFormulationBean.onFlowProcessViewProduct}" id="wizardView" widgetVar="wizardView" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del producto">

                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scProductFormulationBean.searchImage(scProductFormulationBean.productSelected.pathPicture)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                        </td>
                                        <td colspan="2"></td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameProductFormulation" value="Nombre Producto*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameProductFormulation"  value="#{scProductFormulationBean.productSelected.description}"
                                                            disabled = "true"/>
                                        </td>

                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDate" value="Fecha de Caducidad"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:calendar    id="tfExpiryDate"  value="#{scProductFormulationBean.productSelected.expiryDate}" autocomplete="true"
                                                           effect="explode" mask="true" pattern="dd/MM/yyyy" disabled = "true"
                                                           />
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterial" value="Tipo de Material*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfTypeMaterial"  value="#{scProductFormulationBean.productSelected.typeMaterial}" autocomplete="true"
                                                            disabled="true"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueProductFormulation" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueProductFormulation"  value="#{scProductFormulationBean.productSelected.value}" 
                                                            requiredMessage="Debe ingresar el valor del producto" style="width: 100px;" disabled="true"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scProductFormulationBean.productSelected.money}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scProductFormulationBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkProductFormulation" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkProductFormulation"  value="#{scProductFormulationBean.productSelected.mark}"
                                                            requiredMessage="Campo obligatorio debe ingresar la marca del producto" disabled="true"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieProductFormulation" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieProductFormulation"  value="#{scProductFormulationBean.productSelected.serie}"
                                                            disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scProductFormulationBean.productSelected.supplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scProductFormulationBean.productSelected.costCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scProductFormulationBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfStore" value="Almacén*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfStore"  value="#{scProductFormulationBean.productSelected.location.store}" style="width: 70%;"
                                                             converter="storeConverter" converterMessage="Error en el tipo de dato del almacén"
                                                             effect="puff" disabled="true"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.storesList}" var="stores" itemLabel="#{stores.name}"/>

                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbLocation" value="Localización*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbLocation"  value="#{scProductFormulationBean.productSelected.location}" style="width: 70%;" 
                                                             converter="inputLocationConverter" converterMessage="Error en el tipo de dato de la localización del producto"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="#{scProductFormulationBean.productSelected.location.location}" />
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scProductFormulationBean.productSelected.priority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbPackingUnit" value="Unidad de Empaque*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbPackingUnit"  value="#{scProductFormulationBean.productSelected.packingUnit}" 
                                                             converter="packingUnitConverter" converterMessage="Error en el tipo de dato de la unidad de empaque" style="width: 70%; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scProductFormulationBean.packingUnitsList}" var="units" itemLabel="#{units.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales-->

                        <!--                        inicia la pestaña para las dimensiones-->
                        <p:tab title="Dimensiones" id="tabDimension" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las dimensiones">

                            <p:panel header="Dimensiones" id="pnlDimension">

                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scProductFormulationBean.productSelected.dimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;" disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scProductFormulationBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" 
                                                             height="140" disabled="true" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scProductFormulationBean.productSelected.dimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;" disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scProductFormulationBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" disabled="true"
                                                             height="140" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scProductFormulationBean.productSelected.dimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;" disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scProductFormulationBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scProductFormulationBean.productSelected.dimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; " disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scProductFormulationBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scProductFormulationBean.productSelected.dimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;" disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scProductFormulationBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scProductFormulationBean.productSelected.dimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;" disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scProductFormulationBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scProductFormulationBean.productSelected.dimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;" disabled="true">
                                                <p:ajax event="keyup" update=":formWizardView:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scProductFormulationBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="CcbCostCenterampo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scProductFormulationBean.productSelected.dimension.observations}"
                                                               style="width: 98%;"    disabled="true" />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para dimensiones-->
                        <!--                        inicia pestaña para especificaciones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones del producto">
                            <p:panel header="Especificaciones" >

                                <p:dataTable id="dataTableSpecificationSave"
                                             var="specifications" 
                                             value="#{scProductFormulationBean.getListAttached('ESPECIFICACION', scProductFormulationBean.productSelected.scProductAttached)}"
                                             rowKey="#{specifications.tittle}"
                                             paginator="true" rows="10"  
                                             pageLinks="40" editable="true"
                                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                             liveResize="true" rowsPerPageTemplate="15,30,50"
                                             paginatorPosition="top"
                                             sortBy="#{specifications.tittle}">

                                    <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                        <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                        <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                    </p:column>
                                    <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                        <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                        <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                    </p:column>
                                </p:dataTable>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características del producto">
                            <p:panel header="Características" >

                                <p:dataTable id="dataTableFeactureSave"
                                             var="feactures" 
                                             value="#{scProductFormulationBean.getListAttached('CARACTERISTICA', scProductFormulationBean.productSelected.scProductAttached)}"
                                             rowKey="#{feactures.tittle}"
                                             paginator="true" rows="10"  
                                             pageLinks="40" editable="true"
                                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                             liveResize="true" rowsPerPageTemplate="15,30,50"
                                             paginatorPosition="top"
                                             sortBy="#{feactures.tittle}">

                                    <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                        <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                        <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                    </p:column>
                                    <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                        <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                        <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                    </p:column>
                                </p:dataTable>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones del producto">
                            <p:panel header="Observaciones" >

                                <p:dataTable id="dataTableObservationSave"
                                             var="observation" 
                                             value="#{scProductFormulationBean.getListAttached('OBSERVACION', scProductFormulationBean.productSelected.scProductAttached)}"
                                             rowKey="#{observation.tittle}"
                                             paginator="true" rows="10"  
                                             pageLinks="40" editable="true"
                                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                             liveResize="true" rowsPerPageTemplate="15,30,50"
                                             paginatorPosition="top"
                                             sortBy="#{observation.tittle}">

                                    <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                        <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                        <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                    </p:column>
                                    <p:column  headerText="Observación" sortBy="#{observation.description}">
                                        <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                        <p:tooltip value="#{observation.description}" for="outDescription"/>
                                    </p:column>
                                </p:dataTable>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del producto">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scProductFormulationBean.productSelected.scProductDocuments}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-arrowthickstop-1-s" update="dataTableDocumentationSave" title="Descargar Documento"
                                                                     process="@this" ajax="false" onstart="start()" oncomplete="stop()"
                                                                     actionListener="#{scProductFormulationBean.downloadDocument(document)}" >
                                                    </p:commandButton>
                                                </p:column>

                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->                        

                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardView').loadStep('tabGeneral', true)" />
            </p:dialog>
            <!--                Finaliza el dialogo para visualizar formulaciones de producto-->
            <!--====================================================================================================================================================-->

            <!--             inicia el dialogo para eliminar registros           -->
            <p:dialog id="dialogProductDelete" widgetVar="dialogProductDelete" position="center top" 
                      closable="true" draggable="true" dynamic="true" header="Eliminar Formulaciones de Productos"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="false">
                <h:form id="formWizardDelete">
                    <table width="100%" cellspacing="30" style="padding: 0px; margin: 0px;">
                        <tr>
                            <td>
                                <p:outputLabel value="¿Desea eliminar la formulación del producto
                                               #{scProductFormulationBean.productSelected.description}?" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <p:commandButton value="Eliminar" actionListener="#{scProductFormulationBean.deleteProductFormulation()}"  
                                                 onsuccess="PF('dialogProductDelete').hide()"
                                                 update="@this,:formProductFormulation:scDataTableProductFormulations"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" oncomplete="PF('dialogProductDelete').hide()"
                                                 update="@this"/>
                            </td>
                        </tr>
                    </table>
                </h:form>

            </p:dialog>
            <!--            finaliza el dialogo para eliminar registros            -->
            <!--====================================================================================================================================================-->
            <!--            Inicia el dialogo para actualizar formulaciones de producto-->
            <p:dialog id="dialogProductUpdate" widgetVar="dialogProductUpdate" draggable="true" 
                      closable="true"  header="Actualizar Productos" position="center top" width="900"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">
                <h:form id="formWizardUpdate" >

                    <p:wizard  flowListener="#{scProductFormulationBean.onFlowProcessUpdateProduct}" id="wizardUpdate" widgetVar="wizardUpdate" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos del Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del producto">

                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scProductFormulationBean.searchImage(scProductFormulationBean.productSelected.pathPicture)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnPicture" icon="ui-icon-image"  oncomplete="PF('pictureUpdate').show()" style="top: -10px;"
                                                              ignoreAutoUpdate="true"/>                                       
                                        </td>
                                        <td colspan="2">
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameProductFormulation" value="Nombre Producto*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameProductFormulation"  value="#{scProductFormulationBean.productSelected.description}"
                                                            />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDate" value="Fecha de Caducidad"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:calendar    id="tfExpiryDate"  value="#{scProductFormulationBean.productSelected.expiryDate}" autocomplete="true"
                                                           effect="explode" mask="true" pattern="dd/MM/yyyy"
                                                           />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterial" value="Tipo de Material*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfTypeMaterial"  value="#{scProductFormulationBean.productSelected.typeMaterial}" autocomplete="true"
                                                            requiredMessage="Debe ingresar el tipo de material" />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueProductFormulation" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueProductFormulation"  value="#{scProductFormulationBean.productSelected.value}" 
                                                            requiredMessage="Debe ingresar el valor del producto" style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scProductFormulationBean.productSelected.money}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scProductFormulationBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkProductFormulation" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkProductFormulation"  value="#{scProductFormulationBean.productSelected.mark}"
                                                            requiredMessage="Campo obligatorio debe ingresar la marca del producto"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieProductFormulation" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieProductFormulation"  value="#{scProductFormulationBean.productSelected.serie}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scProductFormulationBean.productSelected.supplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scProductFormulationBean.productSelected.costCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scProductFormulationBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddCostCenter" icon="ui-icon-circle-plus"  oncomplete="PF('centerCostSave').show()" style="top: -8px;"/>
                                            <p:tooltip for="btnAddCostCenter" value="Agregue nuevos centros de costos"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfStore" value="Almacén*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfStore"  value="#{scProductFormulationBean.storeSelected}" style="width: 70%;"
                                                             converter="storeConverter" converterMessage="Error en el tipo de dato del almacén"
                                                             effect="puff"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.storesList}" var="stores" itemLabel="#{stores.name}"/>
                                                <p:ajax event="change" update="cbLocation,btnAddLocationProductFormulation" listener="#{scProductFormulationBean.withOutStore(scProductFormulationBean.storeSelected)}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbLocation" value="Localización*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbLocation"  value="#{scProductFormulationBean.productSelected.location}" style="width: 70%;" 
                                                             converter="inputLocationConverter" converterMessage="Error en el tipo de dato de la localización del producto"
                                                             effect="puff" disabled="#{scProductFormulationBean.withOutStore(scProductFormulationBean.storeSelected)}"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scProductFormulationBean.inputLocationsList}" var="inputLocations" itemLabel="#{inputLocations.location}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddLocationProductFormulation" icon="ui-icon-circle-plus"  oncomplete="PF('inputLocationSave').show()" style="top: -8px;"
                                                              disabled ="#{scProductFormulationBean.withOutStore(scProductFormulationBean.storeSelected)}"/>
                                            <p:tooltip for="btnAddLocationProductFormulation" value="Agregue nuevas localizaciones"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scProductFormulationBean.productSelected.priority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scProductFormulationBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbPackingUnit" value="Unidad de Empaque*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbPackingUnit"  value="#{scProductFormulationBean.productSelected.packingUnit}" 
                                                             converter="packingUnitConverter" converterMessage="Error en el tipo de dato de la unidad de empaque" style="width: 70%; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scProductFormulationBean.packingUnitsList}" var="units" itemLabel="#{units.acronym}"/>

                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddPackingUnit" icon="ui-icon-circle-plus"  oncomplete="PF('unitPackingSave').show()" style="top: -2px;"/>
                                            <p:tooltip for="btnAddPackingUnit" value="Agregue nuevas unidades de empaque"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales-->

                        <!--                        inicia la pestaña para las dimensiones-->
                        <p:tab title="Dimensiones" id="tabDimension" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las dimensiones">

                            <p:panel header="Dimensiones" id="pnlDimension">
                                <f:facet name="header">
                                    <p:commandButton icon="ui-icon-plus" id="btnAddMeasure" style="float: right;"  
                                                     oncomplete="PF('measureSave').show()">
                                        <p:tooltip for="btnAddMeasure" value="Agregar una medida"/>
                                    </p:commandButton>
                                </f:facet>
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scProductFormulationBean.productSelected.dimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scProductFormulationBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.hight, 1)}" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scProductFormulationBean.productSelected.dimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scProductFormulationBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.width, 2)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scProductFormulationBean.productSelected.dimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scProductFormulationBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.large, 3)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scProductFormulationBean.productSelected.dimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; ">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scProductFormulationBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.volume, 4)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scProductFormulationBean.productSelected.dimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scProductFormulationBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.thickness, 5)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scProductFormulationBean.productSelected.dimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scProductFormulationBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.radio, 6)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scProductFormulationBean.productSelected.dimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardUpdate:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scProductFormulationBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="CcbCostCenterampo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scProductFormulationBean.showItem(scProductFormulationBean.productSelected.dimension.weight, 7)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scProductFormulationBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scProductFormulationBean.productSelected.dimension.observations}"
                                                               style="width: 98%;"     />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para dimensiones-->
                        <!--                        inicia pestaña para especificaciones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones del producto">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleSpecification" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleSpecification" value="#{scProductFormulationBean.specificationsSave.tittle}"/>
                                                        <p:tooltip for="tfTittleSpecification" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfSpecificationSave" value="Especificación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfSpecificationSave" value="#{scProductFormulationBean.specificationsSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleSpecification,tfSpecificationSave,dataTableSpecificationSave"
                                                                             actionListener="#{scProductFormulationBean.saveAttached('ESPECIFICACION', scProductFormulationBean.specificationsSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationSave"
                                                         var="specifications" 
                                                         value="#{scProductFormulationBean.getListAttached('ESPECIFICACION', scProductFormulationBean.productSelected.scProductAttached)}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationSave" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationSave" 
                                                                     actionListener="#{scProductFormulationBean.deleteAttached(specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características del producto">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleFeacture" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleFeacture" value="#{scProductFormulationBean.feacturesSave.tittle}"/>
                                                        <p:tooltip for="tfTittleFeacture" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfFeactureSave" value="Característica"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfFeactureSave" value="#{scProductFormulationBean.feacturesSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleFeacture,tfFeactureSave,dataTableFeactureSave"
                                                                             actionListener="#{scProductFormulationBean.saveAttached('CARACTERISTICA', scProductFormulationBean.feacturesSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scProductFormulationBean.getListAttached('CARACTERISTICA', scProductFormulationBean.productSelected.scProductAttached)}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scProductFormulationBean.deleteAttached(feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones del producto">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleObservation" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleObservation" value="#{scProductFormulationBean.observationsSave.tittle}"/>
                                                        <p:tooltip for="tfTittleObservation" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfObservationSave" value="Observación"/>
                                                    </td>
                                                    <td width="60%"> 
                                                        <p:inputTextarea id="tfObservationSave" value="#{scProductFormulationBean.observationsSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleObservation,tfObservationSave,dataTableObservationSave"
                                                                             actionListener="#{scProductFormulationBean.saveAttached('OBSERVACION', scProductFormulationBean.observationsSave)}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scProductFormulationBean.getListAttached('OBSERVACION', scProductFormulationBean.productSelected.scProductAttached)}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scProductFormulationBean.deleteAttached(observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del producto">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scProductFormulationBean.productSelected.scProductDocuments}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                                                     oncomplete="PF('documentUpdate').show()">
                                                        <p:tooltip for="btnAdd" value="Agregar un Documento"/> 
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableDocumentationSave" title="Eliminar Documentos"
                                                                     process="@this" 
                                                                     actionListener="#{scProductFormulationBean.deleteDocumentUpdate(document)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scProductFormulationBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->   
                        <!--                        inicia pestaña para procesos-->
                        <p:tab title="Procesos" id="tabProcess" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del producto">
                            <p:panel header="Procesos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableProcessUpdate"
                                                         var="process" 
                                                         value="#{scProductFormulationBean.productSelected.processProducts}"
                                                         rowKey="#{process.idProcessProduct}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{process.idProcessProduct}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAddProcess" style="float: right;"  
                                                                     oncomplete="PF('dialogprocessUpdate').show()">
                                                        <p:tooltip for="btnAddProcess" value="Agregar un Proceso"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="text-align: center;">
                                                    
                                                    <p:commandButton icon="ui-icon-pencil" title="Actualizar Proceso"
                                                                     process="@this" oncomplete="PF('dialogprocessUpdate').show()" update=":formWizardProcessUpdate"
                                                                     actionListener="#{scProductFormulationBean.selectedForUpdateFromSave(process)}" >
                                                    </p:commandButton>
                                                    <p:spacer width="5"/>
                                                    <p:commandButton icon="ui-icon-close" update="dataTableProcessUpdate" title="Eliminar Proceso"
                                                                     process="@this" 
                                                                     actionListener="#{scProductFormulationBean.deleteProcess(scProductFormulationBean.productSelected.processProducts, process)}" >
                                                    </p:commandButton>
                                                    
                                                </p:column>
                                                <p:column  headerText="Proceso" sortBy="#{process.name}">
                                                    <p:outputLabel value="#{process.name}" id="processName"/>
                                                    <p:tooltip value="#{process.name}" for="processName"/>
                                                </p:column>               
                                                <p:column  headerText="Tipo" sortBy="#{process.processType.type}">
                                                    <p:outputLabel value="#{process.processType.type}" id="processType"/>
                                                    <p:tooltip value="#{process.processType.type}" for="processType"/>
                                                </p:column>
                                                <p:column  headerText="Descripción" sortBy="#{process.description}">
                                                    <p:outputLabel value="#{process.description}" id="processDescription"/>
                                                    <p:tooltip value="#{process.description}" for="processDescription"/>
                                                </p:column>
                                                <p:column  headerText="Tiempo Total" sortBy="#{process.totalTimeProcess}">
                                                    <p:outputLabel value="#{process.totalTimeProcess} minutos" id="totalTimeProcess"/>
                                                    <p:tooltip value="#{process.totalTimeProcess}" for="totalTimeProcess"/>
                                                </p:column>
                                                <p:column  headerText="Valor Total" sortBy="#{process.totalValueProcess}">
                                                    <p:outputLabel value="#{process.totalValueProcess} $" id="totalValueProcess"/>
                                                    <p:tooltip value="#{process.totalValueProcess} $" for="totalValueProcess"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para procesos                     -->   
                        <!--        inicia la pestaña para confirmar datos de guardar-->
                        <p:tab title="Confirmar datos" id="tabConfirmSave" titleStyleClass="tabTittleSavePerson"
                               titletip="Pestaña para confirmar los datos del Producto a actualizar">
                            <p:panel header="Crear Producto" style="text-align: center;">
                                <table width="98%" cellspacing="10" style="text-align: center;">
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameproductSelected" value="Nombre Producto"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfNameproductSelected"  value="#{scProductFormulationBean.productSelected.description}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDateSave" value="Tiempo de Preparación"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfExpiryDateSave"  value="#{scProductFormulationBean.productSelected.manufacturingTime} Minutos"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterialSave" value="Tipo de Material"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfTypeMaterialSave"  value="#{scProductFormulationBean.productSelected.typeMaterial}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueproductSelected" value="Valor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfValueproductSelected"  value="#{scProductFormulationBean.productSelected.value}"/>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkproductSelected" value="Marca"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfMarkproductSelected"  value="#{scProductFormulationBean.productSelected.mark}"
                                                              />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieproductSelected" value="Serie"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfSerieproductSelected"  value="#{scProductFormulationBean.productSelected.serie}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="98%" colspan="2">
                                            <p:commandButton id="btnSaveProductFormulation" value="Guardar Producto" onsuccess="PF('dialogProductUpdate').hide()"
                                                             actionListener="#{scProductFormulationBean.updateProductFormulation()}" update=":formProductFormulation:scDataTableProductFormulations,:formWizardUpdate"
                                                             oncomplete="PF('wizardUpdate').loadStep('tabGeneral', false)"/>
                                            <p:spacer width="30"/>
                                            <p:commandButton id="btnCancelPartner" value="Cancelar" oncomplete="PF('dialogProductUpdate').hide();PF('wizardUpdate').loadStep('tabGeneral', false)"
                                                             actionListener="#{scProductFormulationBean.joinColumnsUpdate()}"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>

                        </p:tab>
                        <!--        finaliza la pestaña para confirmar datos de guardar-->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardUpdate').loadStep('tabGeneral', true)" listener="#{scProductFormulationBean.joinColumnsUpdate()}"/>
            </p:dialog>
            <!--                Finaliza el dialogo para actualizar formulaciones de producto-->














            <!--           dialogo para crear un centro de costos-->
            <p:dialog id="centerCostSave" widgetVar="centerCostSave" draggable="true"  
                      closable="true"  header="Agregar un Centro de Costos" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formCostCenter">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAreaCostCenter" value="Nombre del Área"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAreaCostCenter"  value="#{scProductFormulationBean.costCenterSave.description}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el área del centro de costos"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfcodigoCostCenter" value="Código"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfcodigoCostCenter"  value="#{scProductFormulationBean.costCenterSave.costCenter}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el código del centro de costos"/>
                            </td>
                        </tr>
                        <tr>

                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scProductFormulationBean.addCostCenter()}"  
                                                 onsuccess="PF('centerCostSave').hide()"
                                                 update="@this,tfAreaCostCenter,tfcodigoCostCenter,:formWizardSave:cbCostCenter,:formWizardUpdate:cbCostCenter"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scProductFormulationBean.cleanFieldsCostCenter()}" 
                                                 oncomplete="PF('centerCostSave').hide()"
                                                 update="@this,tfAreaCostCenter,tfcodigoCostCenter"/>
                            </td>
                        </tr>
                    </table> 
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear un centro de costos-->
            <!--           dialogo para crear una medida-->
            <p:dialog id="measureSave" widgetVar="measureSave" draggable="true" 
                      closable="true"  header="Agregar una Medida" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formMeasure">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAcronym" value="Medida"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAcronym"  value="#{scProductFormulationBean.measureUnitSave.acronym}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar la unidad de medida"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfTypeMeasure" value="Tipo"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfTypeMeasure"  value="#{scProductFormulationBean.measureUnitSave.type}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el tipo de medida"/>
                            </td>
                        </tr>
                        <tr>

                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scProductFormulationBean.addMeasure()}"  
                                                 onsuccess="PF('measureSave').hide()"
                                                 update="@this,tfAcronym,tfTypeMeasure,:formWizardSave:cbMeasureHigh,:formWizardSave:cbMeasureWidth,:formWizardSave:cbMeasureLarge,
                                                 :formWizardSave:cbMeasureVolume,:formWizardSave:cbMeasureThickness,:formWizardSave:cbMeasureRadio,:formWizardSave:cbMeasureWeight
                                                 ,:formWizardUpdate:cbMeasureHigh,:formWizardUpdate:cbMeasureWidth,:formWizardUpdate:cbMeasureLarge,
                                                 :formWizardUpdate:cbMeasureVolume,:formWizardUpdate:cbMeasureThickness,:formWizardUpdate:cbMeasureRadio,
                                                 :formWizardUpdate:cbMeasureWeight"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scProductFormulationBean.cleanFieldsMeasure()}" 
                                                 oncomplete="PF('measureSave').hide()"
                                                 update="@this,tfAcronym,tfTypeMeasure"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear una medida-->

            <!--           dialogo para crear unidades de empaque-->
            <p:dialog id="unitPackingSave" widgetVar="unitPackingSave" draggable="true" 
                      closable="true"  header="Agregar una Unidad de Empaque" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formUnitPacking">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAcronym" value="Abreviatura"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAcronym"  value="#{scProductFormulationBean.packingUnitSave.acronym}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar la abreviatura de la unidad de empaque"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfDescriptionPacking" value="Descripción"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputTextarea    id="tfDescriptionPacking"  value="#{scProductFormulationBean.packingUnitSave.description}"
                                                    />
                            </td>
                        </tr>
                        <tr>

                            <td align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scProductFormulationBean.addPackingUnit()}"  
                                                 onsuccess="PF('unitPackingSave').hide()"
                                                 update="@this,tfAcronym,tfDescriptionPacking,:formWizardSave:cbPackingUnit,:formWizardUpdate:cbPackingUnit"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scProductFormulationBean.cleanFieldsPackingUnit()}" 
                                                 oncomplete="PF('unitPackingSave').hide()"
                                                 update="tfAcronym,tfDescriptionPacking,@this"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear unidades de empaque del producto-->


            <!--           dialogo para crear localizaciones-->
            <p:dialog id="inputLocationSave" widgetVar="inputLocationSave" draggable="true" 
                      closable="true"  header="Agregar una Localización del Producto" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formInputLocation">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfLocation" value="Localización"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfLocation"  value="#{scProductFormulationBean.inputLocationSave.location}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar la localización del producto"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfDescriptionLocation" value="Descripción"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputTextarea    id="tfDescriptionLocation"  value="#{scProductFormulationBean.inputLocationSave.description}"
                                                    />
                            </td>
                        </tr>
                        <tr>



                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scProductFormulationBean.addInputLocations()}"  
                                                 onsuccess="PF('inputLocationSave').hide()"
                                                 update="@this,tfDescriptionLocation,tfLocation,:formWizardSave:cbLocation,:formWizardUpdate:cbLocation"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scProductFormulationBean.cleanFieldsLocationInput()}" 
                                                 oncomplete="PF('inputLocationSave').hide()"
                                                 update="tfDescriptionLocation,tfLocation,@this"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear localizaciones del producto-->

            <!--            Dialogo para subir imagenes width="10%" align="right" -->
            <p:dialog id="pictureSave" widgetVar="pictureSave" draggable="true" 
                      closable="true"  header="Cargar Imagen..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:fileUpload label="Imagen del Producto" value="#{scProductFormulationBean.pictureFile}" mode="simple"
                                      >       >        
                        </p:fileUpload>

                        <p:commandButton id="btnLoadDocument" value="Cargar" icon="ui-icon-circle-arrow-s"
                                         actionListener="#{scProductFormulationBean.handleFileUpload(1)}" ajax="false" ignoreAutoUpdate="true"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para subir imagenes-->

            <!--            Dialogo para actualizar imagenes width="10%" align="right" -->
            <p:dialog id="pictureUpdate" widgetVar="pictureUpdate" draggable="true" 
                      closable="true"  header="Cargar Imagen..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:fileUpload label="Imagen del Producto" value="#{scProductFormulationBean.pictureFile}" mode="simple"
                                      >       >        
                        </p:fileUpload>

                        <p:commandButton id="btnLoadDocumentUpdate" value="Cargar" icon="ui-icon-circle-arrow-s"
                                         actionListener="#{scProductFormulationBean.handleFileUpload(2)}" ajax="false" ignoreAutoUpdate="true" 
                                         update=":formWizardUpdate"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para actualizar imagenes-->

            <!--            Dialogo para subir documentos width="10%" align="right" -->
            <p:dialog id="documentSave" widgetVar="documentSave" draggable="true" 
                      closable="true"  header="Cargar Documento..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:outputLabel for="tfDocument" value="Título del Documento"/>

                        <p:inputText value="#{scProductFormulationBean.documentsSave.documentTittle}" id="tfDocument"/> 

                        <p:fileUpload label="Documento de un Producto" value="#{scProductFormulationBean.fileSave}" mode="simple"
                                      update=":formWizardSave:dataTableDocumentationSave">  
                        </p:fileUpload>

                        <p:commandButton id="btnLoadFile" value="Cargar" icon="ui-icon-circle-arrow-s" 
                                         actionListener="#{scProductFormulationBean.handleDocumentUpload(1)}" ajax="false" 
                                         update=":formWizardSave:dataTableDocumentationSave"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para subir documentos-->

            <!--            Dialogo para subir actualizar -->
            <p:dialog id="documentUpdate" widgetVar="documentUpdate" draggable="true" 
                      closable="true"  header="Actualizar Documento..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:outputLabel for="tfDocumentUpdate" value="Título del Documento"/>

                        <p:inputText value="#{scProductFormulationBean.documentsSave.documentTittle}" id="tfDocumentUpdate"/> 

                        <p:fileUpload label="Documento de un Producto" value="#{scProductFormulationBean.fileSave}" mode="simple"
                                      update=":formWizardUpdate:dataTableDocumentationSave">  
                        </p:fileUpload>

                        <p:commandButton id="btnLoadFileUpdate" value="Cargar" icon="ui-icon-circle-arrow-s" 
                                         actionListener="#{scProductFormulationBean.handleDocumentUpload(2)}" ajax="false" 
                                         update=":formWizardUpdate:dataTableDocumentationSave"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para actualizar documentos-->

            <!--###################################################################################################-->   
            
            <h:form id="formProductFormulation">
                <p:remoteCommand name="productInit" update=":formProductFormulation:scDataTableProductFormulations" />
                <p:dataTable id="scDataTableProductFormulations" draggableColumns="true" emptyMessage="No existe información para visualizar" 
                             value="#{scProductFormulationBean.productList}" var="product"
                             paginator="true" rows="10"  
                             pageLinks="40"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowKey="#{product.idProductFormulation}"
                             resizableColumns="true" 
                             liveResize="true" rowsPerPageTemplate="10,20,30" 
                             selectionMode="single" paginatorPosition="top" selection="#{scProductFormulationBean.productSelected}"
                             sortBy="#{product.idProductFormulation}"
                             >
                    <f:facet name="header">
                        <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;" 
                                         oncomplete="PF('dialogproductSave').show();"
                                         >
                            <p:tooltip for="btnAdd" value="Agregar un Producto"/>
                        </p:commandButton>
                    </f:facet>
                    
                    <p:column filterMatchMode="contains"  filterBy="#{product.description}" headerText="Form. Producto" sortBy="#{product.description}" id="columnProductName">    
                        <center>
                            <p:outputLabel value="#{product.description}" id="lblProductFormulationName"/>
                            <p:tooltip for="lblProductFormulationName" value="#{product.description}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{product.mark}" id="columnMark" headerText="Marca" sortBy="#{product.mark}">    
                        <center>
                            <p:outputLabel value="#{product.mark}" id="lblMark"/>
                            <p:tooltip for="lblMark" value="#{product.mark}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{product.serie}" id="columnSerie" headerText="Serie" sortBy="#{product.serie}">    
                        <center>
                            <p:outputLabel value="#{product.serie}" id="lblSerie"/>
                            <p:tooltip for="lblSerie" value="#{product.serie}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{product.location.store.name}" id="columnStore" headerText="Almacen" sortBy="#{product.location.store.name}">    
                        <center>
                            <p:outputLabel value="#{product.location.store.name}" id="lblStore"/>
                            <p:tooltip for="lblStore" value="#{product.location.store.name}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{product.location.location}" id="columnLocation" headerText="Localización" sortBy="#{product.location.location}">    
                        <center>
                            <p:outputLabel value="#{product.location.location}" id="lblLocation"/>
                            <p:tooltip for="lblLocation" value="#{product.location.location}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{product.manufacturingTime}" id="columnManufacturingTime" headerText="Timpo de Preparación" sortBy="#{product.manufacturingTime}">    
                        <center>
                            <p:outputLabel value="#{product.manufacturingTime}" id="lblManufacturingTime"/>
                            <p:tooltip for="lblManufacturingTime" value="#{product.manufacturingTime}"/>
                        </center>
                    </p:column>

                    <p:column filterMatchMode="contains"  filterBy="#{product.packingUnit.acronym}" id="columPackingUnit" headerText="Und. Empaque" sortBy="#{product.packingUnit}">    
                        <center>
                            <p:outputLabel value="#{product.packingUnit.acronym}" id="lblPackingUnit"/>
                            <p:tooltip for="lblPackingUnit" value="#{product.packingUnit.acronym}"/>
                        </center>
                    </p:column>

                    <p:column filterMatchMode="contains"  filterBy="#{product.value} #{product.money.acronym}" id="columnValue" headerText="Valor" sortBy="#{product.value}">    
                        <center>
                            <p:outputLabel value="#{product.value} #{product.money.acronym}" id="lblValue"/>
                            <p:tooltip for="lblValue" value="#{product.value} #{product.money.acronym}" />
                        </center>
                    </p:column>
                    
                    <p:column headerText="Admin" width="100">
                        <center>
                            <p:commandButton icon="ui-icon-search" id="btnSearch" update=":formWizardView"
                            actionListener="#{scProductFormulationBean.selectedForView(product)}"
                            oncomplete="PF('dialogProductView').show()">
                                <p:tooltip for="btnSearch" value="Visualizar una Formulación de Producto"/>
                            </p:commandButton>
                            <p:spacer width="3"/>
                            <p:commandButton icon="ui-icon-pencil" id="btnEdit" actionListener="#{scProductFormulationBean.selectedForUpdate(product)}"
                                             oncomplete="PF('dialogProductUpdate').show()" update=":formWizardUpdate"
                                             >
                                <p:tooltip for="btnEdit" value="Editar un Producto"/>
                            </p:commandButton>
                            <p:spacer width="3"/>
                            <p:commandButton icon="ui-icon-close" id="btnDelete" actionListener="#{scProductFormulationBean.selectedForDelete(product)}"
                                             oncomplete="PF('dialogProductDelete').show()" update=":formWizardDelete">
                                <p:tooltip for="btnDelete" value="Eliminar un Producto"/>
                            </p:commandButton>
                        </center>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </h:body>
</html>

